<template>
	<view v-if="isFlag" class="scrool-page">
		<scroll-view scroll-y="true" style="height: 88%;width: 750rpx;background-color: #ffffff;margin-top: 20rpx;margin-bottom: 10rpx;" scroll-with-animation="true">
			<view class="role-text" v-html="htmlStr">
			</view>
		</scroll-view>
		<view>
			<button v-if="loginFlag != 'true'"  class="my-button-special" @click="getClick">同意</button>
			<button v-if="loginFlag == 'true'"  class="my-button-special" @click="getClick">确定</button>
		</view>
	</view>
</template>

<script>
	export default {
		name:"ruleDisplay",
		data() {
			return {
				htmlStr:'',
				url:'',
				isFlag:false,
				loginFlag:'false',
			};
		},
		methods: {
			getClick() {
				if(this.loginFlag == 'true'){
					uni.navigateBack()
				}else{
					uni.redirectTo({
						url:this.url
					})
				}
			}
		},
		onLoad(option) {
			this.htmlStr = option.htmlStr
			this.url = option.url
			this.loginFlag = option.url
			console.log(this.url)
			if(this.htmlStr == ''){
				uni.redirectTo({
					url:this.url
				})
			}else{
				this.isFlag = true
			}
		}
	}
</script>

<style>
	page {
		width: 100%;
		height: 100%;
		background-color: #FFFFFF;
	}
	.container-APP {
		padding-bottom: 100rpx;
		height: 1000rpx;
		width: 700rpx;
		background-color: #FFFFFF;
		border-radius: 10rpx;
	}
	.role-text {
		height: ;
		margin-right: 20rpx;
		margin-left: 20rpx;
	}
	.my-button-special {
		width: 500rpx;
		height: 6%;
		line-height: 80rpx;
		border-radius: 40rpx;
		background-color: rgba(0, 121, 254, 1);
		color: #FFFFFF;
		font-size: 30rpx;
		margin-top: 20rpx;
		position: absolute;
		bottom: 20rpx;
		left: 125rpx;
	}
	
	.scrool-page {
		display: flex;
		flex-direction: column;
		width: 100%;
		height: 100%;
	}
	
	.header-cont {
		width: 100%;
		height: 110rpx;
		line-height: 100rpx;
		text-align: center;
		background: red;
	}
	
	.list-cont {
		flex: 1;
		position: relative;
	
		.scrool-more {
			position: absolute;
			left: 0;
			right: 0;
			top: 0;
			bottom: 0;
		}
	
		.list {
			height: 80rpx;
			line-height: 80rpx;
			text-align: center;
			background: #e0e0e0;
	
		}
	}
	
	
	.footer {
		color: #fff;
		line-height: 100rpx;
		flex: 0 0 100rpx;
		/* 不放大不缩小固定100rpx */
	}
</style>
